Computer programs are groups of instructions that describe actions to be performed by a computer or other processor-based device. When a computer program is loaded and executed on computer hardware, the computer will behave in a predetermined manner by following the instructions of the computer program. Accordingly, the computer becomes a specialized machine that performs the tasks prescribed by the instructions.
A programmer using a programming language creates the instructions comprising a computer program. Typically, source code is specified or edited by a programmer manually and/or with help of an integrated development environment (IDE). Subsequently, the source code can be compiled or otherwise transformed by another program into computer instructions executable by a computer or like device.
A programming language is selected as a function many factors including language safety and expressiveness. Most languages can be classified based on their type system. A type system defines program behavior by how expressions, values and the like are classified into types and the interaction between types. Types afford constraints on interpretation of data in accordance with a language type system. Accordingly, types can be utilized to detect programming errors via a type checking system. In other words, a degree of program safety can be achieved by detecting meaningless or likely invalid code as a function of data types. Languages that employ such type constrains are typed languages (e.g., C, C#, VB, Java . . . ) while languages that do not are un-typed languages (e.g., assembly).
Typed languages can further be categorized based on when types are checked. Two categories of typed languages are statically typed and dynamically typed. A statically typed language enables a program to be type checked at compile time. Hence, all types should be known at compile time by explicit type specification or type inference, for example. Dynamically typed languages differ in that they are type checked at runtime. As a consequence, types need not be explicitly specified or inferable prior to use. Rather, they are determined during execution.
When selecting a language, programmers need to consider tradeoffs between static and dynamic typing. In particular, static typing is beneficial in that errors can be detected prior to execution and programs can execute very efficiently. Further, design time experience can be improved since assistance such as automatic fills and suggestions can be provided as a function of types. However, sometimes statically typed languages can be too restrictive. For example, a strict type system may not allow a programmer to make a desired method call. Dynamically typed languages allow more flexibility. In particular, they provide a means to bypass restrictions of a type system. Among other things, this allows a variable to take on types as a function of program execution. The disadvantage is significant in that any type errors associated with such a program will emerge at runtime.